﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Linq.Mapping;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using DbLinq.Linq;
using DbLinq.Linq.Mapping;

namespace APMS.WebSite.Models.DataStore
{
    /// <summary>
    /// MySQLDataStore is the DAL for MySQL Database
    /// </summary>
    /// <version>$Revision$ $Date$</version>
    /// <history>
    /// <record>08/27/2008. raQuiam - Created this file</record>
    /// </history>
    public class MySQLDataStore : DbLinq.Linq.DataContext, IDataStore
    {
        #region Constructors
        public MySQLDataStore(System.Data.IDbConnection connection)
            : base(connection, new DbLinq.MySql.MySqlVendor())
        { }

        public MySQLDataStore(System.Data.IDbConnection connection, DbLinq.Vendor.IVendor vendor)
            : base(connection, vendor)
        { }
        #endregion

        #region Properties
        public Table<Chat> Chat { get { return GetTable<Chat>(); } }
        public Table<ChatInG> ChatInG { get { return GetTable<ChatInG>(); } }
        public Table<Comment> Comment { get { return GetTable<Comment>(); } }
        public Table<Message> Message { get { return GetTable<Message>(); } }
        public Table<Project> Project { get { return GetTable<Project>(); } }
        public Table<ProjectUser> ProjectUser { get { return GetTable<ProjectUser>(); } }
        public Table<ToDo> ToDo { get { return GetTable<ToDo>(); } }
        public Table<ToDoItem> ToDoItem { get { return GetTable<ToDoItem>(); } }
        public Table<Users> Users { get { return GetTable<Users>(); } }
        public Table<WriteBoard> WriteBoard { get { return GetTable<WriteBoard>(); } }
        public Table<WriteBoardComment> WriteBoardComment { get { return GetTable<WriteBoardComment>(); } }
        public Table<WriteBoardVersion> WriteBoardVersion { get { return GetTable<WriteBoardVersion>(); } }
        #endregion
    }



    [Table(Name = "apms.chating")]
    public partial class ChatInG : INotifyPropertyChanged
    {
        #region INotifyPropertyChanged handling

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion

        #region System.DateTime AddDate

        private System.DateTime addDate;
        [DebuggerNonUserCode]
        [Column(Storage = "addDate", Name = "add_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime AddDate
        {
            get
            {
                return addDate;
            }
            set
            {
                if (value != addDate)
                {
                    addDate = value;
                    OnPropertyChanged("AddDate");
                }
            }
        }

        #endregion

        #region int ChatID

        private int chatID;
        [DebuggerNonUserCode]
        [Column(Storage = "chatID", Name = "chat_id", DbType = "int", CanBeNull = false, Expression = null)]
        public int ChatID
        {
            get
            {
                return chatID;
            }
            set
            {
                if (value != chatID)
                {
                    chatID = value;
                    OnPropertyChanged("ChatID");
                }
            }
        }

        #endregion

        #region string ChatInGDetail

        private string chatInGdEtail;
        [DebuggerNonUserCode]
        [Column(Storage = "chatInGdEtail", Name = "chating_detail", DbType = "text", CanBeNull = false, Expression = null)]
        public string ChatInGDetail
        {
            get
            {
                return chatInGdEtail;
            }
            set
            {
                if (value != chatInGdEtail)
                {
                    chatInGdEtail = value;
                    OnPropertyChanged("ChatInGDetail");
                }
            }
        }

        #endregion

        #region int ChatInGID

        [AutoGenId]
        private int chatInGid;
        [DebuggerNonUserCode]
        [Column(Storage = "chatInGid", Name = "chating_id", DbType = "int", IsPrimaryKey = true, IsDbGenerated = true, CanBeNull = false, Expression = null)]
        public int ChatInGID
        {
            get
            {
                return chatInGid;
            }
            set
            {
                if (value != chatInGid)
                {
                    chatInGid = value;
                    OnPropertyChanged("ChatInGID");
                }
            }
        }

        #endregion

        #region System.DateTime ModifyDate

        private System.DateTime modifyDate;
        [DebuggerNonUserCode]
        [Column(Storage = "modifyDate", Name = "modify_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime ModifyDate
        {
            get
            {
                return modifyDate;
            }
            set
            {
                if (value != modifyDate)
                {
                    modifyDate = value;
                    OnPropertyChanged("ModifyDate");
                }
            }
        }

        #endregion

        #region string UserName

        private string userName;
        [DebuggerNonUserCode]
        [Column(Storage = "userName", Name = "user_name", DbType = "varchar(15)", CanBeNull = false, Expression = null)]
        public string UserName
        {
            get
            {
                return userName;
            }
            set
            {
                if (value != userName)
                {
                    userName = value;
                    OnPropertyChanged("UserName");
                }
            }
        }

        #endregion

    }

    [Table(Name = "apms.chat")]
    public partial class Chat : INotifyPropertyChanged
    {
        #region INotifyPropertyChanged handling

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion

        #region System.DateTime AddDate

        private System.DateTime addDate;
        [DebuggerNonUserCode]
        [Column(Storage = "addDate", Name = "add_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime AddDate
        {
            get
            {
                return addDate;
            }
            set
            {
                if (value != addDate)
                {
                    addDate = value;
                    OnPropertyChanged("AddDate");
                }
            }
        }

        #endregion

        #region int ChatID

        [AutoGenId]
        private int chatID;
        [DebuggerNonUserCode]
        [Column(Storage = "chatID", Name = "chat_id", DbType = "int", IsPrimaryKey = true, IsDbGenerated = true, CanBeNull = false, Expression = null)]
        public int ChatID
        {
            get
            {
                return chatID;
            }
            set
            {
                if (value != chatID)
                {
                    chatID = value;
                    OnPropertyChanged("ChatID");
                }
            }
        }

        #endregion

        #region string ChatRoomName


        private string chatRoomName;
        [DebuggerNonUserCode]
        [Column(Storage = "chatRoomName", Name = "chatroom_name", DbType = "text", CanBeNull = false, Expression = null)]
        public string ChatRoomName
        {
            get
            {
                return chatRoomName;
            }
            set
            {
                if (value != chatRoomName)
                {
                    chatRoomName = value;
                    OnPropertyChanged("ChatRoomName");
                }
            }
        }

        #endregion

        #region int ProjectID

        private int projectID;
        [DebuggerNonUserCode]
        [Column(Storage = "projectID", Name = "project_id", DbType = "int", CanBeNull = false, Expression = null)]
        public int ProjectID
        {
            get
            {
                return projectID;
            }
            set
            {
                if (value != projectID)
                {
                    projectID = value;
                    OnPropertyChanged("ProjectID");
                }
            }
        }

        #endregion

        #region string UserName

        private string userName;
        [DebuggerNonUserCode]
        [Column(Storage = "userName", Name = "user_name", DbType = "varchar(15)", CanBeNull = false, Expression = null)]
        public string UserName
        {
            get
            {
                return userName;
            }
            set
            {
                if (value != userName)
                {
                    userName = value;
                    OnPropertyChanged("UserName");
                }
            }
        }

        #endregion

        public string ToString()
        {
            return (
            base.ToString() + "<BR>" +
            "AddDate : " + AddDate.ToShortTimeString() + "<BR>" +
            "ChatID : " + ChatID.ToString() + "<BR>" +
            "chatRoomName : " + chatRoomName + "<BR>" +
            "ProjectID : " + ProjectID.ToString() + "<BR>" +
            "UserName : " + UserName + "<BR>");
        }


    }

    [Table(Name = "apms.comment")]
    public partial class Comment : INotifyPropertyChanged
    {
        #region INotifyPropertyChanged handling

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion

        #region System.DateTime AddDate

        private System.DateTime addDate;
        [DebuggerNonUserCode]
        [Column(Storage = "addDate", Name = "add_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime AddDate
        {
            get
            {
                return addDate;
            }
            set
            {
                if (value != addDate)
                {
                    addDate = value;
                    OnPropertyChanged("AddDate");
                }
            }
        }

        #endregion

        #region string CommentDetail

        private string commentDetail;
        [DebuggerNonUserCode]
        [Column(Storage = "commentDetail", Name = "comment_detail", DbType = "text", CanBeNull = false, Expression = null)]
        public string CommentDetail
        {
            get
            {
                return commentDetail;
            }
            set
            {
                if (value != commentDetail)
                {
                    commentDetail = value;
                    OnPropertyChanged("CommentDetail");
                }
            }
        }

        #endregion

        #region int CommentID

        [AutoGenId]
        private int commentID;
        [DebuggerNonUserCode]
        [Column(Storage = "commentID", Name = "comment_id", DbType = "int", IsPrimaryKey = true, IsDbGenerated = true, CanBeNull = false, Expression = null)]
        public int CommentID
        {
            get
            {
                return commentID;
            }
            set
            {
                if (value != commentID)
                {
                    commentID = value;
                    OnPropertyChanged("CommentID");
                }
            }
        }

        #endregion

        #region int MessageID

        private int messageID;
        [DebuggerNonUserCode]
        [Column(Storage = "messageID", Name = "message_id", DbType = "int", CanBeNull = false, Expression = null)]
        public int MessageID
        {
            get
            {
                return messageID;
            }
            set
            {
                if (value != messageID)
                {
                    messageID = value;
                    OnPropertyChanged("MessageID");
                }
            }
        }

        #endregion

        #region System.DateTime ModifyDate

        private System.DateTime modifyDate;
        [DebuggerNonUserCode]
        [Column(Storage = "modifyDate", Name = "modify_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime ModifyDate
        {
            get
            {
                return modifyDate;
            }
            set
            {
                if (value != modifyDate)
                {
                    modifyDate = value;
                    OnPropertyChanged("ModifyDate");
                }
            }
        }

        #endregion

        #region string UserName

        private string userName;
        [DebuggerNonUserCode]
        [Column(Storage = "userName", Name = "user_name", DbType = "varchar(15)", CanBeNull = false, Expression = null)]
        public string UserName
        {
            get
            {
                return userName;
            }
            set
            {
                if (value != userName)
                {
                    userName = value;
                    OnPropertyChanged("UserName");
                }
            }
        }

        #endregion

        public string ToString()
        {
            return (
            base.ToString() + "<BR>" +
            "AddDate : " + AddDate.ToShortTimeString() + "<BR>" +
            "CommentDetail : " + CommentDetail + "<BR>" +
            "CommentID : " + CommentID.ToString() + "<BR>" +
            "MessageID : " + MessageID.ToString() + "<BR>" +
            "ModifyDate : " + ModifyDate.ToShortDateString() + "<BR>" +
            "UserName : " + UserName + "<BR>");
        }



    }

    [Table(Name = "apms.message")]
    public partial class Message : INotifyPropertyChanged
    {
        #region INotifyPropertyChanged handling

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion

        #region System.DateTime AddDate

        private System.DateTime addDate;
        [DebuggerNonUserCode]
        [Column(Storage = "addDate", Name = "add_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime AddDate
        {
            get
            {
                return addDate;
            }
            set
            {
                if (value != addDate)
                {
                    addDate = value;
                    OnPropertyChanged("AddDate");
                }
            }
        }

        #endregion

        #region string MessageDetail

        private string messageDetail;
        [DebuggerNonUserCode]
        [Column(Storage = "messageDetail", Name = "message_detail", DbType = "text", CanBeNull = false, Expression = null)]
        public string MessageDetail
        {
            get
            {
                return messageDetail;
            }
            set
            {
                if (value != messageDetail)
                {
                    messageDetail = value;
                    OnPropertyChanged("MessageDetail");
                }
            }
        }

        #endregion

        #region int MessageID

        [AutoGenId]
        private int messageID;
        [DebuggerNonUserCode]
        [Column(Storage = "messageID", Name = "message_id", DbType = "int", IsPrimaryKey = true, IsDbGenerated = true, CanBeNull = false, Expression = null)]
        public int MessageID
        {
            get
            {
                return messageID;
            }
            set
            {
                if (value != messageID)
                {
                    messageID = value;
                    OnPropertyChanged("MessageID");
                }
            }
        }

        #endregion

        #region string MessageTopic

        private string messageTopic;
        [DebuggerNonUserCode]
        [Column(Storage = "messageTopic", Name = "message_topic", DbType = "text", CanBeNull = false, Expression = null)]
        public string MessageTopic
        {
            get
            {
                return messageTopic;
            }
            set
            {
                if (value != messageTopic)
                {
                    messageTopic = value;
                    OnPropertyChanged("MessageTopic");
                }
            }
        }

        #endregion

        #region System.DateTime ModifyDate

        private System.DateTime modifyDate;
        [DebuggerNonUserCode]
        [Column(Storage = "modifyDate", Name = "modify_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime ModifyDate
        {
            get
            {
                return modifyDate;
            }
            set
            {
                if (value != modifyDate)
                {
                    modifyDate = value;
                    OnPropertyChanged("ModifyDate");
                }
            }
        }

        #endregion

        #region int ProjectID

        private int projectID;
        [DebuggerNonUserCode]
        [Column(Storage = "projectID", Name = "project_id", DbType = "int", CanBeNull = false, Expression = null)]
        public int ProjectID
        {
            get
            {
                return projectID;
            }
            set
            {
                if (value != projectID)
                {
                    projectID = value;
                    OnPropertyChanged("ProjectID");
                }
            }
        }

        #endregion

        #region string UserName

        private string userName;
        [DebuggerNonUserCode]
        [Column(Storage = "userName", Name = "user_name", DbType = "varchar(15)", CanBeNull = false, Expression = null)]
        public string UserName
        {
            get
            {
                return userName;
            }
            set
            {
                if (value != userName)
                {
                    userName = value;
                    OnPropertyChanged("UserName");
                }
            }
        }

        #endregion


        public string ToString()
        {
            return (
            base.ToString() + "<BR>" +
            "AddDate : " + AddDate.ToShortTimeString() + "<BR>" +
            "MessageDetail : " + MessageDetail + "<BR>" +
            "MessageID : " + MessageID.ToString() + "<BR>" +
            "MessageTopic : " + MessageTopic + "<BR>" +
            "ModifyDate : " + ModifyDate.ToShortDateString() + "<BR>" +
            "ProjectID : " + ProjectID.ToString() + "<BR>" +
            "UserName : " + UserName + "<BR>");
        }


    }

    [Table(Name = "apms.project")]
    public partial class Project : INotifyPropertyChanged
    {
        #region INotifyPropertyChanged handling

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion

        #region System.DateTime AddDate

        private System.DateTime addDate;
        [DebuggerNonUserCode]
        [Column(Storage = "addDate", Name = "add_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime AddDate
        {
            get
            {
                return addDate;
            }
            set
            {
                if (value != addDate)
                {
                    addDate = value;
                    OnPropertyChanged("AddDate");
                }
            }
        }

        #endregion

        #region string Logo

        private string logo;
        [DebuggerNonUserCode]
        [Column(Storage = "logo", Name = "logo", DbType = "text", CanBeNull = false, Expression = null)]
        public string Logo
        {
            get
            {
                return logo;
            }
            set
            {
                if (value != logo)
                {
                    logo = value;
                    OnPropertyChanged("Logo");
                }
            }
        }

        #endregion

        #region System.DateTime ModifyDate

        private System.DateTime modifyDate;
        [DebuggerNonUserCode]
        [Column(Storage = "modifyDate", Name = "modify_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime ModifyDate
        {
            get
            {
                return modifyDate;
            }
            set
            {
                if (value != modifyDate)
                {
                    modifyDate = value;
                    OnPropertyChanged("ModifyDate");
                }
            }
        }

        #endregion

        #region int ProjectID

        [AutoGenId]
        private int projectID;
        [DebuggerNonUserCode]
        [Column(Storage = "projectID", Name = "project_id", DbType = "int", IsPrimaryKey = true, IsDbGenerated = true, CanBeNull = false, Expression = null)]
        public int ProjectID
        {
            get
            {
                return projectID;
            }
            set
            {
                if (value != projectID)
                {
                    projectID = value;
                    OnPropertyChanged("ProjectID");
                }
            }
        }

        #endregion

        #region string ProjectName

        private string projectName;
        [DebuggerNonUserCode]
        [Column(Storage = "projectName", Name = "project_name", DbType = "text", CanBeNull = false, Expression = null)]
        public string ProjectName
        {
            get
            {
                return projectName;
            }
            set
            {
                if (value != projectName)
                {
                    projectName = value;
                    OnPropertyChanged("ProjectName");
                }
            }
        }

        #endregion

        public string ToString()
        {
            return (
            base.ToString() + "<BR>" +
            "AddDate : " + AddDate.ToShortTimeString() + "<BR>" +
            "Logo : " + Logo + "<BR>" +
            "ModifyDate : " + ModifyDate.ToShortDateString() + "<BR>" +
            "ProjectID : " + ProjectID.ToString() + "<BR>" +
            "ProjectName : " + ProjectName + "<BR>");
        }


    }

    [Table(Name = "apms.project_user")]
    public partial class ProjectUser : INotifyPropertyChanged
    {
        #region INotifyPropertyChanged handling

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion

        #region System.DateTime JoinDate

        private System.DateTime joinDate;
        [DebuggerNonUserCode]
        [Column(Storage = "joinDate", Name = "join_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime JoinDate
        {
            get
            {
                return joinDate;
            }
            set
            {
                if (value != joinDate)
                {
                    joinDate = value;
                    OnPropertyChanged("JoinDate");
                }
            }
        }

        #endregion

        #region int ProjectID

        private int projectID;
        [DebuggerNonUserCode]
        [Column(Storage = "projectID", Name = "project_id", DbType = "int", IsPrimaryKey = true, CanBeNull = false, Expression = null)]
        public int ProjectID
        {
            get
            {
                return projectID;
            }
            set
            {
                if (value != projectID)
                {
                    projectID = value;
                    OnPropertyChanged("ProjectID");
                }
            }
        }

        #endregion

        #region string UserName

        private string userName;
        [DebuggerNonUserCode]
        [Column(Storage = "userName", Name = "user_name", DbType = "varchar(15)", IsPrimaryKey = true, CanBeNull = false, Expression = null)]
        public string UserName
        {
            get
            {
                return userName;
            }
            set
            {
                if (value != userName)
                {
                    userName = value;
                    OnPropertyChanged("UserName");
                }
            }
        }

        #endregion

        public string ToString()
        {
            return (
            base.ToString() + "<BR>" +
            "JoinDate : " + JoinDate.ToString() + "<BR>" +
            "ProjectID : " + ProjectID.ToString() + "<BR>" +
            "UserName : " + UserName + "<BR>");
        }

    }

    [Table(Name = "apms.todo")]
    public partial class ToDo : INotifyPropertyChanged
    {
        #region INotifyPropertyChanged handling

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion

        #region System.DateTime AddDate

        private System.DateTime addDate;
        [DebuggerNonUserCode]
        [Column(Storage = "addDate", Name = "add_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime AddDate
        {
            get
            {
                return addDate;
            }
            set
            {
                if (value != addDate)
                {
                    addDate = value;
                    OnPropertyChanged("AddDate");
                }
            }
        }

        #endregion

        #region System.DateTime ModifyDate

        private System.DateTime modifyDate;
        [DebuggerNonUserCode]
        [Column(Storage = "modifyDate", Name = "modify_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime ModifyDate
        {
            get
            {
                return modifyDate;
            }
            set
            {
                if (value != modifyDate)
                {
                    modifyDate = value;
                    OnPropertyChanged("ModifyDate");
                }
            }
        }

        #endregion

        #region int ProjectID

        private int projectID;
        [DebuggerNonUserCode]
        [Column(Storage = "projectID", Name = "project_id", DbType = "int", CanBeNull = false, Expression = null)]
        public int ProjectID
        {
            get
            {
                return projectID;
            }
            set
            {
                if (value != projectID)
                {
                    projectID = value;
                    OnPropertyChanged("ProjectID");
                }
            }
        }

        #endregion

        #region int ToDoID

        [AutoGenId]
        private int toDoID;
        [DebuggerNonUserCode]
        [Column(Storage = "toDoID", Name = "todo_id", DbType = "int", IsPrimaryKey = true, IsDbGenerated = true, CanBeNull = false, Expression = null)]
        public int ToDoID
        {
            get
            {
                return toDoID;
            }
            set
            {
                if (value != toDoID)
                {
                    toDoID = value;
                    OnPropertyChanged("ToDoID");
                }
            }
        }

        #endregion

        #region string ToDoName

        private string toDoName;
        [DebuggerNonUserCode]
        [Column(Storage = "toDoName", Name = "todo_name", DbType = "text", CanBeNull = false, Expression = null)]
        public string ToDoName
        {
            get
            {
                return toDoName;
            }
            set
            {
                if (value != toDoName)
                {
                    toDoName = value;
                    OnPropertyChanged("ToDoName");
                }
            }
        }

        #endregion

        #region string UserName

        private string userName;
        [DebuggerNonUserCode]
        [Column(Storage = "userName", Name = "user_name", DbType = "varchar(15)", CanBeNull = false, Expression = null)]
        public string UserName
        {
            get
            {
                return userName;
            }
            set
            {
                if (value != userName)
                {
                    userName = value;
                    OnPropertyChanged("UserName");
                }
            }
        }

        #endregion

        public string ToString()
        {
            return (
            base.ToString() + "<BR>" +
            "AddDate : " + AddDate.ToShortTimeString() + "<BR>" +
            "ModifyDate : " + ModifyDate.ToShortDateString() + "<BR>" +
            "ProjectID : " + ProjectID.ToString() + "<BR>" +
            "ToDoID : " + ToDoID.ToString() + "<BR>" +
            "ToDoName : " + ToDoName + "<BR>" +
            "UserName : " + UserName + "<BR>");
        }
    }

    [Table(Name = "apms.todo_item")]
    public partial class ToDoItem : INotifyPropertyChanged
    {
        #region INotifyPropertyChanged handling

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion

        #region System.DateTime AddDate

        private System.DateTime addDate;
        [DebuggerNonUserCode]
        [Column(Storage = "addDate", Name = "add_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime AddDate
        {
            get
            {
                return addDate;
            }
            set
            {
                if (value != addDate)
                {
                    addDate = value;
                    OnPropertyChanged("AddDate");
                }
            }
        }

        #endregion

        #region string AssignBy

        private string assignBy;
        [DebuggerNonUserCode]
        [Column(Storage = "assignBy", Name = "assign_by", DbType = "varchar(15)", CanBeNull = false, Expression = null)]
        public string AssignBy
        {
            get
            {
                return assignBy;
            }
            set
            {
                if (value != assignBy)
                {
                    assignBy = value;
                    OnPropertyChanged("AssignBy");
                }
            }
        }

        #endregion

        #region string AssignTo

        private string assignTo;
        [DebuggerNonUserCode]
        [Column(Storage = "assignTo", Name = "assign_to", DbType = "varchar(15)", CanBeNull = false, Expression = null)]
        public string AssignTo
        {
            get
            {
                return assignTo;
            }
            set
            {
                if (value != assignTo)
                {
                    assignTo = value;
                    OnPropertyChanged("AssignTo");
                }
            }
        }

        #endregion

        #region System.DateTime DeathLine

        private System.DateTime deathLine;
        [DebuggerNonUserCode]
        [Column(Storage = "deathLine", Name = "death_line", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime DeathLine
        {
            get
            {
                return deathLine;
            }
            set
            {
                if (value != deathLine)
                {
                    deathLine = value;
                    OnPropertyChanged("DeathLine");
                }
            }
        }

        #endregion

        #region System.DateTime ModifyDate

        private System.DateTime modifyDate;
        [DebuggerNonUserCode]
        [Column(Storage = "modifyDate", Name = "modify_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime ModifyDate
        {
            get
            {
                return modifyDate;
            }
            set
            {
                if (value != modifyDate)
                {
                    modifyDate = value;
                    OnPropertyChanged("ModifyDate");
                }
            }
        }

        #endregion

        #region int ToDoID

        private int toDoID;
        [DebuggerNonUserCode]
        [Column(Storage = "toDoID", Name = "todo_id", DbType = "int", CanBeNull = false, Expression = null)]
        public int ToDoID
        {
            get
            {
                return toDoID;
            }
            set
            {
                if (value != toDoID)
                {
                    toDoID = value;
                    OnPropertyChanged("ToDoID");
                }
            }
        }

        #endregion

        #region string ToDoItemDetail

        private string toDoItemDetail;
        [DebuggerNonUserCode]
        [Column(Storage = "toDoItemDetail", Name = "todo_item_detail", DbType = "text", CanBeNull = false, Expression = null)]
        public string ToDoItemDetail
        {
            get
            {
                return toDoItemDetail;
            }
            set
            {
                if (value != toDoItemDetail)
                {
                    toDoItemDetail = value;
                    OnPropertyChanged("ToDoItemDetail");
                }
            }
        }

        #endregion

        #region int ToDoItemID

        [AutoGenId]
        private int toDoItemID;
        [DebuggerNonUserCode]
        [Column(Storage = "toDoItemID", Name = "todo_item_id", DbType = "int", IsPrimaryKey = true, IsDbGenerated = true, CanBeNull = false, Expression = null)]
        public int ToDoItemID
        {
            get
            {
                return toDoItemID;
            }
            set
            {
                if (value != toDoItemID)
                {
                    toDoItemID = value;
                    OnPropertyChanged("ToDoItemID");
                }
            }
        }

        #endregion

        public string ToString()
        {
            return (
            base.ToString() + "<BR>" +
            "AddDate : " + AddDate.ToShortTimeString() + "<BR>" +
            "AssignBy : " + AssignBy + "<BR>" +
            "AssignTo : " + AssignTo + "<BR>" +
            "DeathLine : " + DeathLine.ToShortDateString() + "<BR>" +
            "ModifyDate : " + ModifyDate.ToShortDateString() + "<BR>" +
            "ToDoID : " + ToDoID.ToString() + "<BR>" +
            "ToDoItemDetail : " + ToDoItemDetail + "<BR>" +
            "ToDoItemID : " + ToDoItemID.ToString() + "<BR>");
        }
    }

    [Table(Name = "apms.users")]
    public partial class Users : INotifyPropertyChanged
    {
        #region INotifyPropertyChanged handling

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion

        #region System.DateTime AddDate

        private System.DateTime addDate;
        [DebuggerNonUserCode]
        [Column(Storage = "addDate", Name = "add_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime AddDate
        {
            get
            {
                return addDate;
            }
            set
            {
                if (value != addDate)
                {
                    addDate = value;
                    OnPropertyChanged("AddDate");
                }
            }
        }

        #endregion

        #region string Email

        private string email;
        [DebuggerNonUserCode]
        [Column(Storage = "email", Name = "email", DbType = "text", CanBeNull = false, Expression = null)]
        public string Email
        {
            get
            {
                return email;
            }
            set
            {
                if (value != email)
                {
                    email = value;
                    OnPropertyChanged("Email");
                }
            }
        }

        #endregion

        #region string FirstName

        private string firstName;
        [DebuggerNonUserCode]
        [Column(Storage = "firstName", Name = "firstname", DbType = "text", CanBeNull = false, Expression = null)]
        public string FirstName
        {
            get
            {
                return firstName;
            }
            set
            {
                if (value != firstName)
                {
                    firstName = value;
                    OnPropertyChanged("FirstName");
                }
            }
        }

        #endregion

        #region string Image

        private string image;
        [DebuggerNonUserCode]
        [Column(Storage = "image", Name = "image", DbType = "text", CanBeNull = false, Expression = null)]
        public string Image
        {
            get
            {
                return image;
            }
            set
            {
                if (value != image)
                {
                    image = value;
                    OnPropertyChanged("Image");
                }
            }
        }

        #endregion

        #region string LastName

        private string lastName;
        [DebuggerNonUserCode]
        [Column(Storage = "lastName", Name = "lastname", DbType = "text", CanBeNull = false, Expression = null)]
        public string LastName
        {
            get
            {
                return lastName;
            }
            set
            {
                if (value != lastName)
                {
                    lastName = value;
                    OnPropertyChanged("LastName");
                }
            }
        }

        #endregion

        #region System.DateTime ModifyDate

        private System.DateTime modifyDate;
        [DebuggerNonUserCode]
        [Column(Storage = "modifyDate", Name = "modify_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime ModifyDate
        {
            get
            {
                return modifyDate;
            }
            set
            {
                if (value != modifyDate)
                {
                    modifyDate = value;
                    OnPropertyChanged("ModifyDate");
                }
            }
        }

        #endregion

        #region string PassWord

        private string passWord;
        [DebuggerNonUserCode]
        [Column(Storage = "passWord", Name = "pass_word", DbType = "varchar(15)", CanBeNull = false, Expression = null)]
        public string PassWord
        {
            get
            {
                return passWord;
            }
            set
            {
                if (value != passWord)
                {
                    passWord = value;
                    OnPropertyChanged("PassWord");
                }
            }
        }

        #endregion

        #region string UserName

        private string userName;
        [DebuggerNonUserCode]
        [Column(Storage = "userName", Name = "user_name", DbType = "varchar(15)", IsPrimaryKey = true, CanBeNull = false, Expression = null)]
        public string UserName
        {
            get
            {
                return userName;
            }
            set
            {
                if (value != userName)
                {
                    userName = value;
                    OnPropertyChanged("UserName");
                }
            }
        }

        #endregion

        public string ToString()
        { 
            return (
            base.ToString() + "<BR>" +
            "UserName : " + UserName + "<BR>" +
            "PassWord : " + PassWord + "<BR>" +
            "FirstName : " + FirstName + "<BR>" +
            "LastName : " + LastName + "<BR>" +
            "Email : " + Email + "<BR>" +
            "AddDate : " + AddDate.ToShortDateString() + "<BR>" +
            "ModifyDate : " + ModifyDate.ToShortDateString() + "<BR>" +
            "Image : " + Image + "<BR>"); 
        }

    }

    [Table(Name = "apms.writeboard")]
    public partial class WriteBoard : INotifyPropertyChanged
    {
        #region INotifyPropertyChanged handling

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion

        #region System.DateTime AddDate

        private System.DateTime addDate;
        [DebuggerNonUserCode]
        [Column(Storage = "addDate", Name = "add_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime AddDate
        {
            get
            {
                return addDate;
            }
            set
            {
                if (value != addDate)
                {
                    addDate = value;
                    OnPropertyChanged("AddDate");
                }
            }
        }

        #endregion

        #region int ProjectID

        private int projectID;
        [DebuggerNonUserCode]
        [Column(Storage = "projectID", Name = "project_id", DbType = "int", CanBeNull = false, Expression = null)]
        public int ProjectID
        {
            get
            {
                return projectID;
            }
            set
            {
                if (value != projectID)
                {
                    projectID = value;
                    OnPropertyChanged("ProjectID");
                }
            }
        }

        #endregion

        #region int WriteBoardID

        [AutoGenId]
        private int writeBoardID;
        [DebuggerNonUserCode]
        [Column(Storage = "writeBoardID", Name = "writeboard_id", DbType = "int", IsPrimaryKey = true, IsDbGenerated = true, CanBeNull = false, Expression = null)]
        public int WriteBoardID
        {
            get
            {
                return writeBoardID;
            }
            set
            {
                if (value != writeBoardID)
                {
                    writeBoardID = value;
                    OnPropertyChanged("WriteBoardID");
                }
            }
        }

        #endregion

        public string ToString()
        {
            return (
            base.ToString() + "<BR>" +
            "AddDate : " + AddDate.ToShortDateString() + "<BR>" +
            "ProjectID : " + ProjectID.ToString() + "<BR>" +
            "WriteBoardID : " + WriteBoardID.ToString() + "<BR>" );
        }
    }

    [Table(Name = "apms.writeboard_comment")]
    public partial class WriteBoardComment : INotifyPropertyChanged
    {
        #region INotifyPropertyChanged handling

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion

        #region System.DateTime AddDate

        private System.DateTime addDate;
        [DebuggerNonUserCode]
        [Column(Storage = "addDate", Name = "add_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime AddDate
        {
            get
            {
                return addDate;
            }
            set
            {
                if (value != addDate)
                {
                    addDate = value;
                    OnPropertyChanged("AddDate");
                }
            }
        }

        #endregion

        #region string CommentDetail

        private string commentDetail;
        [DebuggerNonUserCode]
        [Column(Storage = "commentDetail", Name = "comment_detail", DbType = "text", CanBeNull = false, Expression = null)]
        public string CommentDetail
        {
            get
            {
                return commentDetail;
            }
            set
            {
                if (value != commentDetail)
                {
                    commentDetail = value;
                    OnPropertyChanged("CommentDetail");
                }
            }
        }

        #endregion

        #region System.DateTime ModifyDate

        private System.DateTime modifyDate;
        [DebuggerNonUserCode]
        [Column(Storage = "modifyDate", Name = "modify_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime ModifyDate
        {
            get
            {
                return modifyDate;
            }
            set
            {
                if (value != modifyDate)
                {
                    modifyDate = value;
                    OnPropertyChanged("ModifyDate");
                }
            }
        }

        #endregion

        #region string UserName

        private string userName;
        [DebuggerNonUserCode]
        [Column(Storage = "userName", Name = "user_name", DbType = "varchar(15)", CanBeNull = false, Expression = null)]
        public string UserName
        {
            get
            {
                return userName;
            }
            set
            {
                if (value != userName)
                {
                    userName = value;
                    OnPropertyChanged("UserName");
                }
            }
        }

        #endregion

        #region int WriteBoardCommentID

        [AutoGenId]
        private int writeBoardCommentID;
        [DebuggerNonUserCode]
        [Column(Storage = "writeBoardCommentID", Name = "writeboard_comment_id", DbType = "int", IsPrimaryKey = true, IsDbGenerated = true, CanBeNull = false, Expression = null)]
        public int WriteBoardCommentID
        {
            get
            {
                return writeBoardCommentID;
            }
            set
            {
                if (value != writeBoardCommentID)
                {
                    writeBoardCommentID = value;
                    OnPropertyChanged("WriteBoardCommentID");
                }
            }
        }

        #endregion

        #region int WriteBoardID

        private int writeBoardID;
        [DebuggerNonUserCode]
        [Column(Storage = "writeBoardID", Name = "writeboard_id", DbType = "int", CanBeNull = false, Expression = null)]
        public int WriteBoardID
        {
            get
            {
                return writeBoardID;
            }
            set
            {
                if (value != writeBoardID)
                {
                    writeBoardID = value;
                    OnPropertyChanged("WriteBoardID");
                }
            }
        }

        #endregion

        #region int WriteBoardVersionID

        private int writeBoardVersionID;
        [DebuggerNonUserCode]
        [Column(Storage = "writeBoardVersionID", Name = "writeboard_version_id", DbType = "int", CanBeNull = false, Expression = null)]
        public int WriteBoardVersionID
        {
            get
            {
                return writeBoardVersionID;
            }
            set
            {
                if (value != writeBoardVersionID)
                {
                    writeBoardVersionID = value;
                    OnPropertyChanged("WriteBoardVersionID");
                }
            }
        }

        #endregion

        public string ToString()
        {
            return (
            base.ToString() + "<BR>" +
            "AddDate : " + AddDate.ToShortDateString() + "<BR>" +
            "ModifyDate : " + ModifyDate.ToShortDateString() + "<BR>" +
            "UserName : " + UserName + "<BR>" +
            "WriteBoardCommentID : " + WriteBoardCommentID.ToString() + "<BR>" +
            "WriteBoardID : " + WriteBoardID.ToString() + "<BR>" +
            "writeBoardVersionID : " + writeBoardVersionID.ToString() + "<BR>");
        }

    }

    [Table(Name = "apms.writeboard_version")]
    public partial class WriteBoardVersion : INotifyPropertyChanged
    {
        #region INotifyPropertyChanged handling

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion

        #region System.DateTime AddDate

        private System.DateTime addDate;
        [DebuggerNonUserCode]
        [Column(Storage = "addDate", Name = "add_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime AddDate
        {
            get
            {
                return addDate;
            }
            set
            {
                if (value != addDate)
                {
                    addDate = value;
                    OnPropertyChanged("AddDate");
                }
            }
        }

        #endregion

        #region System.DateTime ModifyDate

        private System.DateTime modifyDate;
        [DebuggerNonUserCode]
        [Column(Storage = "modifyDate", Name = "modify_date", DbType = "datetime", CanBeNull = false, Expression = null)]
        public System.DateTime ModifyDate
        {
            get
            {
                return modifyDate;
            }
            set
            {
                if (value != modifyDate)
                {
                    modifyDate = value;
                    OnPropertyChanged("ModifyDate");
                }
            }
        }

        #endregion

        #region string UserName

        private string userName;
        [DebuggerNonUserCode]
        [Column(Storage = "userName", Name = "user_name", DbType = "varchar(15)", CanBeNull = false, Expression = null)]
        public string UserName
        {
            get
            {
                return userName;
            }
            set
            {
                if (value != userName)
                {
                    userName = value;
                    OnPropertyChanged("UserName");
                }
            }
        }

        #endregion

        #region string WriteBoardDetail

        private string writeBoardDetail;
        [DebuggerNonUserCode]
        [Column(Storage = "writeBoardDetail", Name = "writeboard_detail", DbType = "text", CanBeNull = false, Expression = null)]
        public string WriteBoardDetail
        {
            get
            {
                return writeBoardDetail;
            }
            set
            {
                if (value != writeBoardDetail)
                {
                    writeBoardDetail = value;
                    OnPropertyChanged("WriteBoardDetail");
                }
            }
        }

        #endregion

        #region int WriteBoardID

        private int writeBoardID;
        [DebuggerNonUserCode]
        [Column(Storage = "writeBoardID", Name = "writeboard_id", DbType = "int", CanBeNull = false, Expression = null)]
        public int WriteBoardID
        {
            get
            {
                return writeBoardID;
            }
            set
            {
                if (value != writeBoardID)
                {
                    writeBoardID = value;
                    OnPropertyChanged("WriteBoardID");
                }
            }
        }

        #endregion

        #region int WriteBoardVersionID

        [AutoGenId]
        private int writeBoardVersionID;
        [DebuggerNonUserCode]
        [Column(Storage = "writeBoardVersionID", Name = "writeboard_version_id", DbType = "int", IsPrimaryKey = true, IsDbGenerated = true, CanBeNull = false, Expression = null)]
        public int WriteBoardVersionID
        {
            get
            {
                return writeBoardVersionID;
            }
            set
            {
                if (value != writeBoardVersionID)
                {
                    writeBoardVersionID = value;
                    OnPropertyChanged("WriteBoardVersionID");
                }
            }
        }

        #endregion

        public string ToString()
        {
            return (
            base.ToString() + "<BR>" +
            "AddDate : " + AddDate.ToShortDateString() + "<BR>" +
            "ModifyDate : " + ModifyDate.ToShortDateString() + "<BR>" +
            "UserName : " + UserName + "<BR>" +
            "WriteBoardDetail : " + WriteBoardDetail + "<BR>" +
            "WriteBoardID : " + WriteBoardID.ToString() + "<BR>" +
            "WriteBoardVersionID : " + WriteBoardVersionID.ToString() + "<BR>"); 
        }

    }
}
